M = 5
a = []
# 输入5个孩子的苹果数
for s in range(M):
    num = int(input())
    a.append(num)
# 依次做循环计算
for i in range(M):
    t = a[i] // 3
    a[i] = t
    a[(i + M - 1) % M] += t
    a[(i + M + 1) % M] += t
# 依次输出最后结果
for num in a:
    print(num, end=' ')